<?php use_stylesheets_for_form($form) ?>
<?php use_javascripts_for_form($form) ?>

<form action="<?php echo url_for('element/'.($form->getObject()->isNew() ? 'create' : 'update').(!$form->getObject()->isNew() ? '?id_element='.$form->getObject()->getIdElement() : '')) ?>" method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>>
<?php if (!$form->getObject()->isNew()): ?>
<input type="hidden" name="sf_method" value="put" />
<?php endif; ?>
  <table class="formulaire">
      <thead>
          <tr><th colspan="3">Fiche élément</th></tr>
      </thead>
    <tfoot>
      <tr>
        <td colspan="3">
          <?php echo $form->renderHiddenFields(false) ?>
          <input type="submit" value="Enregistrer" class="submit"/>
          <a href="<?php echo url_for('element/index') ?>" class="submit">Annuler</a>
        </td>
      </tr>
    </tfoot>
    <tbody>
      <?php echo $form->renderGlobalErrors() ?>
        <?php if ($form->getObject()->isNew()): ?>
      <tr>
        <th><?php echo $form['id_element']->renderLabel() ?></th>
        <td><?php echo $form['id_element'] ?></td>
        <td><?php echo $form['id_element']->renderError() ?></td>
      </tr>
      <?php endif; ?>
      <tr>
        <th><?php echo $form['nom']->renderLabel() ?></th>
        <td><?php echo $form['nom'] ?></td>
        <td><?php echo $form['nom']->renderError() ?></td>
      </tr>
    </tbody>
  </table>
</form>
